package com.ss.baseinfo.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ss.baseinfo.dao.ClassDao;
import com.ss.baseinfo.pojo.ClassInfo;
/**
 * 班级管理
 * @author Administrator
 *
 */
@Repository("classDao")
public class ClassDaoImpl extends SqlMapClientDaoSupport implements ClassDao {

	@Override
	public void add(ClassInfo info) throws Exception {
		// TODO Auto-generated method stub
		this.getSqlMapClientTemplate().insert("class.add",info);
	}

	@Override
	public int update(ClassInfo info) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().update("class.update",info);
	}

	@Override
	public List<ClassInfo> query(ClassInfo info) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().queryForList("class.query",info);
	}

	@Override
	public ClassInfo getOneById(String id) throws Exception {
		// TODO Auto-generated method stub
		return (ClassInfo)this.getSqlMapClientTemplate().queryForObject("class.getOneById",id);
	}

}
